XK0-006: Linux+ Practice Exam — XK0-006: Linux+

1. The question bank is cloud-based and updates automatically, with no need for re-acquisition.

2. Available in Chinese and English. It supports online practice, mock exams and PDF downloads.

3. You can practice questions via mini-program or desktop web page. The service is valid for one year.

4. For inquiries, please contact customer service via WeChat, WhatsApp or Line.

Exam information

XK0-006: CompTIA Linux+ (New Version)

-Exam Overview: The updated version of XK0-005 for Linux administrators. It focuses on modern Linux operation skills including cloud-native and container technologies.

-Key Specifications:

 - Exam Duration: 90 minutes

 - Number of Questions: Up to 90 (Single choice, multiple choice, performance-based questions)

 - Total Score / Passing Score: 900 / 720

 - Exam Fee: Approximately $392 USD

 - Supported Languages: English, Japanese, etc.

 - Official Registration Link: https://www.comptia.org/certifications/linux

-Core Topics:

 - Modern Linux administration and container fundamentals

 - Advanced command line operations and automation scripting

 - Configuration and security of cloud-native Linux environments

Sample questions

XK0-006: Linux+ · Q1
Topic 1 Question #1 A Linux administrator needs to create and then connect to the app-01-image container. Which of the following commands accomplishes this task?
  • A.
    docker run -it app-01-image
  • B.
    docker start -td app-01-image
  • C.
    docker build -ic app-01-image
  • D.
    docker exec -dc app-01-image

Answer: A

This question assesses container management skills required for the CompTIA Linux+ XK0-006 certification, specifically the ability to perform core Docker container operations. The scenario requires two sequential actions: first, create a new container instance from the existing app-01-image, and second, establish an interactive connection to the newly created container. The correct command must complete both actions in a single valid operation. The docker run command natively combines container creation from a specified image and container startup, and the -it flags enable interactive access to the container immediately on launch, directly fulfilling both requirements of the scenario. Option Analysis: A. Correct. The docker run command creates a new container instance from the specified app-01-image by default if no existing container with that run configuration exists. The -i flag keeps the container's standard input (STDIN) open, and the -t flag allocates a pseudo-TTY terminal interface. Together, these flags connect the administrator's local terminal session directly to the container's shell as soon as the container is created and started, matching both required tasks in the question. B. Incorrect. The docker start command is designed exclusively to start existing, stopped containers, not create new containers from an image. Additionally, the -td flags run the container in detached (background) mode and allocate a TTY but do not attach the administrator's session to the container, so this command fails to both create the container and connect to it. C. Incorrect. The docker build command is used to generate custom container images from a Dockerfile, not to create or run container instances from pre-existing images. The -ic flags listed are not valid standard flags for the docker build command, making this command invalid for the stated task. D. Incorrect. The docker exec command runs additional commands inside an already running container, and cannot create a new container from an image. The -dc flags are not valid standard flags for docker exec, so this command cannot fulfill either the container creation or connection requirements. Key Concepts: 1. Docker Core Command Use Cases: CompTIA Linux+ XK0-006 candidates are required to distinguish between Docker commands for different lifecycle stages: docker build for image creation, docker run for new container creation and startup, docker start for resuming stopped containers, and docker exec for running processes in active containers. This differentiation is critical for selecting the correct command for container operations. 2. Docker Interactive Session Flags: The -i (interactive) and -t (pseudo-TTY) flags are standard paired parameters used to establish an interactive shell connection to a container, a common administrative task tested on the XK0-006 exam. Without these flags, containers launched with docker run run in the background and do not accept user input directly. 3. Container Lifecycle Management: This core XK0-006 Domain 3 (Scripting, Containers, and Automation) competency covers the end-to-end workflow of deploying, accessing, and managing container instances, including the ability to combine creation and access steps for efficiency in administrative tasks. References: CompTIA Linux+ (XK0-006) Exam Objectives, Docker Official Documentation: docker run command reference, https://docs.docker.com/engine/reference/commandline/run/
XK0-006: Linux+ · Q2
Topic 1 Question #2 To perform a live migration, which of the following must match on both host servers? (Choose two).
  • A.
    USB ports
  • B.
    Network speed
  • C.
    Available swap
  • D.
    CPU architecture
  • E.
    Available memory
  • F.
    Disk storage path

Answer: DF

This question aligns with the CompTIA Linux+ XK0-006 virtualization and high availability domain, which covers live migration of Linux-based virtual machines and container workloads between host servers with minimal downtime. The suggested answers D (CPU architecture) and F (Disk storage path) are mandatory requirements for successful live migration. First, identical CPU architecture ensures the running workload does not encounter unrecognized CPU instruction sets after migration, which would cause immediate workload failure. Second, a matching disk storage path ensures the workload maintains uninterrupted access to its persistent storage, which is almost always hosted on shared storage accessible to both hosts during live migration. Mismatches in either of these two configurations will cause the live migration to fail or result in workload outage, making them non-negotiable requirements per XK0-006 exam objectives. Option Analysis: A. USB ports: Incorrect. USB port count, type, or configuration is not a requirement for live migration. Even if USB passthrough is configured for a workload, it can be disabled prior to migration without impacting the migration process, so matching USB ports are not required. B. Network speed: Incorrect. While similar network speeds between hosts are recommended to reduce migration time and avoid performance degradation, they are not a mandatory requirement. Live migration will complete successfully over mismatched network speeds, just with longer transfer times. C. Available swap: Incorrect. Host swap space is independent of the running workload's runtime state during migration. The destination host only requires enough available memory to accommodate the migrated workload, with no requirement to match the source host's available swap space. D. CPU architecture: Correct. Source and destination hosts must use the same CPU vendor and compatible architecture generation to support identical instruction sets for the running workload. Cross-architecture live migration is not supported in standard Linux virtualization implementations (KVM, Xen) as it leads to workload crashes, making this a mandatory requirement per XK0-006 content. E. Available memory: Incorrect. The destination host only needs enough available memory to run the migrated workload, it does not need to match the available memory of the source host. For example, a source with 16GB of available memory can migrate an 8GB workload to a destination with 10GB of available memory successfully. F. Disk storage path: Correct. Live migration relies on shared storage (NFS, iSCSI, Ceph) accessible to both hosts, and the storage path for the workload's persistent volumes or virtual disks must be identical on both hosts. A mismatched path will break storage access for the workload after migration, resulting in outage, so this is a mandatory requirement. Key Concepts: 1. Live Migration Prerequisites: This XK0-006 core concept covers mandatory and recommended configurations for moving running workloads between hosts, including CPU compatibility and consistent shared storage access. 2. CPU Instruction Set Compatibility: This topic explains that active workloads execute directly against the host CPU's instruction set, so cross-architecture migration of running workloads is not supported without performance-prohibitive emulation. 3. Shared Storage Configuration for Clustered Workloads: This domain concept covers that shared storage must be mounted with identical paths across all hosts in a virtualization or container cluster to support seamless workload mobility, including live migration. References: CompTIA Linux+ (XK0-006) Official Exam Objectives, Red Hat Enterprise Linux 9: Configuring and Managing Virtualization - Live Migration Requirements
XK0-006: Linux+ · Q3
Topic 1 Question #3 A Linux systems administrator needs to extract the contents of a file named /home/dev/web.bkp to the /var/www/html/ directory. Which of the following commands should the administrator use?
  • A.
    cd /var/www/html/ && gzip -c /home/dev/web.bkp | tar xf -
  • B.
    pushd /var/www/html/ $$ cpio -idv < /home/dev/web.bkp && popd
  • C.
    tar -c -f /home/dev/web.bkp /var/www/html/
  • D.
    unzip -c /home/dev/web.bkp /var/www/html/

Answer: B

The scenario requires extracting the contents of the /home/dev/web.bkp backup file to the /var/www/html/ target directory. The suggested answer B correctly implements this workflow using standard Linux administration utilities aligned with XK0-006 CompTIA Linux+ objectives. The command first uses pushd to switch the active working directory to the target /var/www/html/ location, ensuring all extracted content is written to the correct path. It then runs cpio in extract mode with appropriate flags to read the backup file from redirected standard input, extract all contents, create missing parent directories as needed, and log activity for verification. Finally, popd returns the administrator to their original working directory to avoid disrupting subsequent operations. This command is flexible enough to handle common cpio-formatted backup files, a widely used archive format for Linux system backups tested on the XK0-006 exam. Option Analysis: A. Incorrect. This command uses gzip -c without the required -d decompression flag, so it writes the unmodified compressed backup content to standard output instead of decompressing it. Even if the -d flag was included, this command assumes the backup is a gzipped tar archive, which is not confirmed by the generic .bkp file extension, and the syntax fails to reliably extract content to the target directory for all valid backup formats. B. Correct. This command follows all requirements for the scenario. pushd /var/www/html/ temporarily changes the working directory to the target extraction path. The cpio -idv command uses -i to enable extract mode, -d to automatically create missing parent directories for extracted files, and -v to verbosely list extracted content for audit. The < redirection operator feeds the /home/dev/web.bkp file to cpio's standard input for processing. The final popd command returns the shell to the original working directory, adhering to Linux administration best practices tested in the XK0-006 exam. C. Incorrect. The tar -c flag enables archive creation mode, not extraction mode. This command would overwrite the existing /home/dev/web.bkp backup file with a new archive containing the contents of /var/www/html/, which is the opposite of the required extraction task. D. Incorrect. First, unzip only supports zip-formatted archives, which is not confirmed for the generic .bkp backup file. Second, the unzip -c flag writes extracted content to standard output instead of writing files to the filesystem, and the command uses incorrect syntax for specifying a target extraction directory, as unzip requires the -d flag to define a target directory instead of accepting a positional path argument. This command will not write extracted content to /var/www/html/ even if the backup is a valid zip archive. Key Concepts: 1. Linux Archiving Utility Competency: The XK0-006 CompTIA Linux+ exam tests knowledge of common archiving tools including cpio, tar, gzip, and unzip, including correct mode flags for extract vs create operations, input/output handling, and format compatibility, which is directly assessed in this question. 2. Working Directory Management: Competency with pushd and popd to temporarily modify the active working directory for targeted file operations, as well as chained command operators such as && to sequence dependent commands, is a core XK0-006 objective for Linux filesystem administration. 3. Shell Redirection: Understanding of standard input/output redirection operators such as < to pass file content to a command's standard input is a foundational XK0-006 skill required to correctly construct archive extraction and file manipulation commands. References: CompTIA Linux+ (XK0-006) Exam Objectives, Linux man-pages Project: cpio(1) Manual Page
XK0-006: Linux+ · Q4
Topic 1 Question #4 Which of the following Ansible components contains a list of hosts and host groups?
  • A.
    Fact
  • B.
    Inventory
  • C.
    Playbook
  • D.
    Collection

Answer: B

The XK0-006 CompTIA Linux+ certification includes explicit objectives covering automation and configuration management tool proficiency, including core Ansible component identification. The question asks for the Ansible component that stores lists of hosts and host groups, which is the defined core function of the Ansible inventory. This component serves as the authoritative source of all target managed nodes Ansible interacts with, and allows administrators to group nodes by function, environment, or other custom attributes to simplify task targeting. The suggested answer B is fully correct as it directly aligns with this documented purpose of the inventory component. Option Analysis: A. Incorrect. Ansible facts are system-specific data points automatically gathered from managed nodes during playbook execution, such as operating system version, IP address, and hardware specifications. Facts do not store lists of hosts or host groups, so this option does not match the question description. B. Correct. The Ansible inventory is the dedicated component that stores a list of all managed hosts, and supports organizing hosts into logical groups such as web servers, database servers, or production environment nodes. It can be implemented as a static flat file with a default location of /etc/ansible/hosts, or as a dynamic inventory for ephemeral or cloud-based environments, directly matching the functionality described in the question. C. Incorrect. Ansible playbooks are YAML-formatted files that define the sequence of tasks, configurations, and workflows to be executed on target hosts. Playbooks reference the inventory to select which hosts to run against, but do not themselves contain the list of hosts and host groups, so this option is incorrect. D. Incorrect. Ansible collections are standardized distribution packages for reusable Ansible content, including modules, roles, plugins, and pre-built playbooks. They are used to share and distribute automation content across teams or public communities, not to store an organization's specific list of managed hosts and host groups, so this option is incorrect. Key Concepts: 1. Ansible Core Component Identification: A core XK0-006 automation objective requires candidates to correctly identify and distinguish between key Ansible components including inventory, playbooks, facts, and collections to demonstrate proficiency with configuration management tools in Linux environments. 2. Ansible Inventory Functionality: The inventory supports both static and dynamic formats to accommodate on-premises, cloud, and hybrid infrastructure, and allows for variable assignment per host or group to customize automation behavior for different node sets. 3. Configuration Management Workflow: XK0-006 tests understanding of end-to-end configuration management workflows, where the inventory is the first component referenced to define target nodes before executing automation tasks defined in playbooks. References: Ansible Documentation - Introduction to Inventory, https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html CompTIA Linux+ (XK0-006) Exam Objectives
XK0-006: Linux+ · Q5
Topic 1 Question #5 Which of the following filesystems contains non-persistent or volatile data?
  • A.
    /boot
  • B.
    /usr
  • C.
    /proc
  • D.
    /var

Answer: C

This question assesses mastery of the Linux Filesystem Hierarchy Standard (FHS), a core domain for the CompTIA Linux+ XK0-006 certification. The correct answer, /proc, is a virtual proc filesystem that resides entirely in system memory and is dynamically generated by the Linux kernel at boot time. It contains no persistent on-disk data: all entries represent real-time runtime information including running process details, kernel configuration parameters, hardware state, and system performance metrics, all of which are generated on demand when a user or process accesses the /proc directory. All data stored in /proc is erased immediately when the system is shut down or rebooted, making it fully non-persistent and volatile, which directly matches the criteria outlined in the question. Option Analysis: A. /boot is incorrect. The /boot directory is a persistent on-disk filesystem that stores static files required for system boot, including bootloader configurations, kernel images, and initramfs files. All data in /boot remains intact across system reboots and power cycles, so it is not volatile. B. /usr is incorrect. The /usr directory contains persistent, shareable read-only system data including user binaries, system libraries, documentation, and installed software utilities. It is stored on a physical disk and retains all data across reboots, so it is not non-persistent. C. /proc is correct. As noted in the answer analysis, /proc is a memory-resident virtual filesystem that exposes runtime kernel and process data on demand. It has no associated permanent disk storage, and all its contents are lost when the system powers off, making it fully volatile and non-persistent. D. /var is incorrect. The /var directory stores variable persistent data that changes during normal system operation, including system logs, print spools, application databases, and cached content. While its contents are updated frequently, it resides on physical disk and retains data across reboots, so it is not volatile. Key Concepts: 1. Linux Filesystem Hierarchy Standard (FHS): The FHS is a standardized specification that defines the purpose and structure of directories in Linux operating systems, distinguishing between persistent storage directories, temporary storage, and virtual system information directories. This is a core tested objective in the XK0-006 Linux+ exam. 2. Virtual Filesystems: Virtual filesystems are kernel abstractions that do not map to physical disk storage, instead exposing internal kernel state, process information, and hardware details as file-like objects that can be accessed with standard file utilities. They are entirely memory-resident and volatile by design. 3. Volatile vs Persistent Storage: Volatile storage loses all stored data when power is removed or the system is restarted, while persistent storage retains data across power cycles. Understanding the distinction between storage types for different Linux directories is required for core Linux administration tasks tested in the XK0-006 exam. References: CompTIA Linux+ (XK0-006) Exam Objectives, Linux Filesystem Hierarchy Standard Version 3.0, https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html

FAQ

How many practice questions are available for XK0-006: Linux+?

This question bank includes 155 XK0-006: Linux+ practice questions covering single and multiple choice, each with answers and explanations.

Are XK0-006: Linux+ practice questions available in Chinese and English?

Yes, XK0-006: Linux+ practice questions are provided in both Chinese and English.

Can I try XK0-006: Linux+ practice questions for free?

Yes. Free sample questions are available on this page, and the full question bank is available after signing up on Zhangxuetu.